$("form").validate({
    rules:{
        adminName:{
            required:true,
            minlength:4,
            maxlength:16
        },
        password:{
            required:true,
        },
        password2:{
            required:true,
            equalTo: "#password"
        },
        sex:{
            required:true,
        },
        phone:{
            required:true,
            isPhone:true,
        },
        email:{
            required:true,
            email:true,
        }
    },
    onkeyup:false,
    focusCleanup:true,
    success:"valid",
    submitHandler:function(form){
        $("input[type='submit']").attr('disabled', true);
        $(form).ajaxSubmit({
            data: {
                "status": "1"
            },
            success: function(data){
                data = $.parseJSON(data)
                if (data.code == '1') {
                    layer.msg('管理员编辑操作成功!',{icon:1,time:1000});
                    var index = parent.layer.getFrameIndex(window.name);
                    parent.layer.close(index);
                }
                layer.msg(data.message,{icon:0,time:1000});
            },
            error: function(XmlHttpRequest, textStatus, errorThrown){
                layer.msg('error!',{icon:0,time:1000});
            }
        });
        $("input[type='submit']").attr('disabled', false);
    }
});